import { LinValidator, Rule } from "../code/lin-validator-v2"
export class ListValidator extends LinValidator {
    constructor() {
        super()
        this.limit = [new Rule('isLength', '一页数据不超100条', {
            max: 2
        })]
        this.page_index = []
    }
    validateCreatedAt(vals: { body: { createdAt: any } }) {
        const createdAt = vals.body.createdAt
        if (!createdAt) return
        if (!createdAt[0] || !createdAt[1]) {
            throw new Error('请确认筛选时间')
        } 
    }
}
export class InfoValidator extends LinValidator {
    constructor() {
        super()
        this.id = []
    }
}

export class NoParames extends LinValidator {
    constructor() {
        super()
    }
}